package com.hemaapp.yjnh.view.calendar;

import java.util.Date;

import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.RelativeSizeSpan;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;

@SuppressWarnings("deprecation")
public class SampleDecorator implements CalendarCellDecorator {
	
	@Override
	public void decorate(CalendarCellView cellView, Date date, String flag) {
		String dateString = Integer.toString(date.getDate());
		//flag = 1:鍏ヤ綇锛宖lag = 2:绂诲紑锛宖lag = 3锛氶兘涓嶆樉绀?
				String title = "";
				if("1".equals(flag))
					title = "鍏ヤ綇";
				else if("2".equals(flag))
					title = "绂诲紑";
			
				SpannableString string = new SpannableString(dateString + "\n"+title);
				string.setSpan(new RelativeSizeSpan(0.9f), 0, dateString.length(),
						Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
				cellView.setText(string);
//				cellView.setOnClickListener(new OnClickListener() {
//					
//					@Override
//					public void onClick(View v) {
//						// TODO Auto-generated method stub
//						Log.d("hahahahahahah", "99999999999999999999999999999999");
//					}
//				});
			}
			
		}
